#ifndef N2COLOR_H_2009_10_09
#define N2COLOR_H_2009_10_09

#include "N1Lib.h"

#ifndef WINDOWS

typedef uint32 COLORREF;

#define GetRValue(c) ((BYTE)(c))
#define GetGValue(c) ((BYTE)(((WORD)(c))>>8))
#define GetBValue(c) ((BYTE)((c)>>16))

#define RGB(r,g,b) ((COLORREF)((BYTE)(r)|((BYTE)(g) << 8)|((BYTE)(b) << 16)))

#endif

class N2Color {
public:
    float r, g, b;

    N2Color(float red, float green, float blue);
    N2Color(COLORREF color);

    operator COLORREF() const ;

    uint8 red()   { return (uint8)(r*255); };
    uint8 green() { return (uint8)(g*255); };
    uint8 blue()  { return (uint8)(b*255); };

    static N2Color whiteColor();
    static N2Color blackColor();
    static N2Color redColor();
    static N2Color greenColor();
    static N2Color blueColor();
};

#endif //N2COLOR_H_2009_10_09
